// 添加收货地址
// POST
// /member/address
import type {AddressParams,AddressItem} from '@/types/address'
import { http } from "@/utils/http"

// /member/address
export const memberAddressAPI = (data:AddressParams) => {
    return http({
        method:'POST',
        url:'/member/address',
        data
    })
}
// 获取收货地址列表
// GET
// /member/address
export const getMemberAddressAPI = ()=> {
    return http<AddressItem[]>({
        method:'GET',
        url:'/member/address'
    })
}
// 获取收货地址详情
// GET @param id 地址id(路径参数)
// /member/address/{id}
export const GETMemberAddressIdAPI = (id:string) => {
    return http<AddressItem>({
        method:'GET',
        url:`/member/address/${id}`
    })
}
// 修改收货地址
// PUT @param id 地址id(路径参数)
// /member/address/{id}
export const PUTMemberAddressByIdAPI = (id:string,data:AddressParams) => {
    return http({
        method:'PUT',
        url:`/member/address/${id}`,
        data,
    })
}
// 删除收货地址
// DELETE
// /member/address/{id}
export const DELETEMemberAddressAPI = (id:string)=> {
    return http({
        method:'DELETE',
        url:`/member/address/${id}`,
    })
}